package com.wang.mall.feign;

import com.wang.mall.config.feign.Auth2FeignConfig;
import com.wang.mall.dto.ProductDto;
import com.wang.mall.model.R;
import com.wang.mall.vo.LockStockResult;
import com.wang.mall.vo.ProductHasStockVo;
import com.wang.mall.vo.WareProductLockVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(value = "product-server", configuration = Auth2FeignConfig.class)
public interface ProductFeignService {


    @PostMapping("/ware/lock/order")
    public R<List<LockStockResult>> orderLock(@RequestBody WareProductLockVo lockVo);


    @GetMapping("/product/info/{id}")
    public R<ProductDto> info(@PathVariable("id") Long id);


    @PostMapping("/product/hasStock")
    public R<List<ProductHasStockVo>> getProductsHasStock(@RequestBody List<Long> productIds);
}
